<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>修改密码</title>
<link href="/css/base.css" type="text/css" rel="stylesheet" />
<link href="/css/manage.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/js/jquery.default.js"></script>
<script type="text/javascript" src="/js/jquery.validate.js"></script>
<script type="text/javascript" src="/js/jquery.form.js"></script>
<!--[if ie]><link href="/css/ie.css" type="text/css" rel="stylesheet"><![endif]-->


</head>

<body>
   <?php $this->load->view('head');?>
    <!-- head--end-->
    <?php $data['curstyle'] = 'memberinfo'?>
    <!-- body -->
    <div class="w100p mt40 mb20">
    	<div class="w903 mg">
        	<div class="box_s1">
            	<div class="b_head"></div>
                <div class="content m_pd_s1">
                	<!-- manage-top -->
                	<?php $this->load->view('member/mangtop',$data)?>
                    <!-- manage-top--end-->
                    
                    <!-- manage-det-->
                   <div class="clearfix">
                    	<div class="box_s3 fl">
                        	<div class="b_head"></div>
                            <?php $data['leftstyle'] = 'modifypwd'?>
                            <?php $this->load->view('member/memberinfoleft',$data)?>
                            <div class="b_foot"></div>
                        </div>
                        
                        <!-- right-ope-->
                        <div class=" m_layout_s1">
                        	<div class="m_pd_s3">
                            	<div class="form_box">
                                    <form action="<?php echo site_url('member/savepmodewd');?>" method="post" id="pwd_manage">
                                        <table class="com_form com_form_s1 mt10 person_m ">
                                            <tbody>
                                                <tr>
                                                    <td width="115" class="col1">用户名:</td><td><span class="un_edit"><?php echo $username?></span></td>
                                                </tr>
                                                <tr>
                                                    <td width="115" class="col1">原密码:</td><td><input type="password" id="before_pwd" class="def_txt_s4" name="before_pwd" /><br class="clear"><div class="validate_v" ></div></td>
                                                </tr>
                                                <tr>
                                                    <td width="115" class="col1">密码:</td><td><input type="password" class="def_txt_s4" name="update_pwd" id="update_pwd" /><br class="clear"><div class="validate_v" ></div></td>
                                                </tr>
                                                <tr>
                                                    <td width="115" class="col1">再次输入密码:</td><td><input type="password" class="def_txt_s4" name="again_update_pwd" /><br class="clear"><div class="validate_v" ></div></td>
                                                </tr>
                                                <tr>
                                                    <td width="115"  ></td><td><input type="submit" id="modify_pwd" class="def_btn_s5 mr10" value="保存"></td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </form>
                                </div>
                            </div>
                        </div>
                        <!-- right-ope--end-->
                        
                        <div class="clear"></div>
                    </div>
                    <!-- manage-det--end-->
                    
                </div>
                <div class="b_foot"></div>
            </div>
        </div>
    </div>
    <!-- body--end-->
    
    <!-- foot-->
   <?php $this->load->view('foot')?>
    <!-- foot--end-->	
</body>
<script type="text/javascript">
$(function(){
	
	$.validator.addMethod("stringCheck", function(value, element) {          
		return this.optional(element) || /^[\u0391-\uFFE5\w]+$/.test(value);       	
	}, "只能包括中文字、英文字母、数字和下划线");  

	$("#pwd_manage").validate({
		submitHandler:function(form){
			var before_pwd = $("#before_pwd").val();
			var update_pwd = $("#update_pwd").val();
			$.post('<?php echo site_url("member/savepwd")?>',{
				before_pwd:before_pwd,
				update_pwd:update_pwd
				},function(data){
					var ret = $.parseJSON(data);
					alert(ret.msg);
				});
			//form.submit();
		} ,
		rules:{
			before_pwd:{
				required:true
			},
			update_pwd:{
				required:true
			},
			again_update_pwd:{
				required:true,
				equalTo:"#update_pwd"
			}
		},
		messages:{
			before_pwd:{
				required:"密码不能为空！"
			},
			update_pwd:{
				required:"密码不能为空！"
			},
			again_update_pwd:{
				required:"密码不能为空",
				equalTo:"两次密码输入不一致，请重新输入！"
			}
		},
		errorPlacement:function(error,element){
			error.appendTo(element.siblings("div.validate_v"));
		}
	});
	
})
</script>
</html>
